﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Jzy.Workflow.Node;
using System.Data;
using Frame.Lib.Core.User;
using Frame.Lib.Core.Tree;
using Frame.Lib.Utilities;


namespace Jzy.Web.WorkFlow.Design
{
    public partial class SelectUser : PageSelectTree
    {
        private FlowNodeBO _node = new FlowNodeBO();
        private string NodeID
        {
            get
            {
                return Request["NodeID"];
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {

            if (!IsPostBack)
            {
                BindTree();
            }
        }

        private void BindTree()
        {
            List<UserInfo> users = _node.GetAllUsers(NodeID);
            foreach (UserInfo info in users)
            {
               
                TreeNode node = new TreeNode();
                node.ShowCheckBox = false;
                node.Text = TreeBO<TreeInfo>.GetCheckBoxNode(info.ID, info.Name, null);

                node.SelectAction = TreeNodeSelectAction.None;
                tv.Nodes.Add(node);
            }
            List<int> lstSelectIDs = StrUtil.SplitToInt(RestoreIDs);

            JSUtil.SetTreeSelect(lstSelectIDs);
        }
    }
}
